<template>
  <view>
    <view class="container">
      <view class="radio-box">
        <u--text text="请选择您的性别"></u--text>
        <view class="radio">
          <u-radio-group v-model="userInfo.sex" placement="row">
            <u-radio :customStyle="{marginLeft: '36rpx'}" v-for="(item, index) in personSexList" :key="index"
              :label="item.name" :name="item.name" shape="square" size="24">
            </u-radio>
          </u-radio-group>
        </view>
      </view>

      <view class="btn">
        <u-button type="success" text="确定" @click="backButton"></u-button>
      </view>
    </view>
  </view>
</template>

<script>
  import {
    mapState,
    mapMutations
  } from 'vuex'

  export default {
    data() {
      return {
        personSexList: [{
            name: '男',
            disabled: false
          },
          {
            name: '女',
            disabled: false
          }
        ],
        
      };
    },
    computed: {
      ...mapState('user', ['userInfo'])
    },
    methods: {
      ...mapMutations('user', ['changeSex', 'backButton'])
    }
  }
</script>

<style lang="scss" scoped>
  .container {
    width: 90%;
    margin: 0 auto;
    margin-top: 20rpx;
    .radio-box {
      .radio {
        margin-top: 24rpx;
      }
    }

    .btn {
      margin: 0 auto;
      margin-top: 500rpx;
      width: 300rpx;
    }
  }
</style>
